package com.xiaoke.api.service;

import com.xiaoke.entity.Order;
import com.xiaoke.util.common.AjaxMsg;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(value = "service")
public interface OrderService {

    @GetMapping("/order/cancelOrder")
    void cancelOrder(@RequestParam("orderId") String orderId);

    @GetMapping("/order/findOrderDetail")
    Map<String,Object> findOrderDetail(@RequestParam("orderId") String orderId);

    @GetMapping("/order/selectByPrimaryKey")
    Order selectByPrimaryKey(@RequestParam("orderId") String orderId);

    @GetMapping("/order/findByUser")
    List<Map<String,Object>> findByUser(@RequestParam("userId") String userId,@RequestParam("pageNum")Integer pageNum,@RequestParam("pageSize")Integer pageSize);

    @GetMapping("/order/createOrder")
    AjaxMsg createOrder(@RequestParam("userId") String userId, @RequestParam("shopId") String shopId, @RequestParam("addressId") String addressId, @RequestParam("couponId") String couponId);

    @GetMapping("/order/buySuccess")
    String buySuccess(@RequestParam("orderSn") String orderSn,@RequestParam("restMsg") String restMsg);
}
